package nc.itf.hrpbm.sjxm.sjxmh;

import java.util.Map;

import nc.vo.pub.BusinessException;
import nc.vo.pub.SuperVO;

import nc.vo.sjxm.sjxm.AggSjxmVO;
import nc.vo.sjxm.sjxm.SjxmHVO;
import nc.pub.billcode.vo.BillCodeContext;

public interface  ISjxmHVOService{

	/**
	 * 四级项目的AGGVO查询操作
	 * 根据主键条件查询Agg数组
	 * @param pk主键
	 * @return 结果数组
	 */
	public AggSjxmVO[] listAggSjxmVOByPk(String... pks) throws BusinessException;

	/**
	 * 四级项目的AGGVO查询操作
	 * 根据主键条件查询Agg数组
	 * @param pk主键
	 * @return 结果数组
	 */
	public AggSjxmVO[] listAggSjxmVOByPk(boolean blazyLoad,String... pks) throws BusinessException;

	/**
	 * 四级项目的AGGVO查询操作
	 * 根据主键条件查询Agg对象
	 * @param pk 主键
	 * @return 结果对象
	 */
	public  AggSjxmVO findAggSjxmVOByPk(String pk) throws BusinessException;

	/**
	 * 四级项目的AGGVO查询操作
	 * 根据条件字符串查询Agg数组
	 * @param condition 主键
	 * @return 结果数组
	 */
	public  AggSjxmVO[] listAggSjxmVOByCondition(String condition) throws BusinessException;

	/**
	 * 四级项目的AGGVO查询操作
	 * 根据条件字符串查询Agg数组
	 * @param condition 条件
	 * @param orderPath 排序集合
	 * @return 结果数组
	 */
	public  AggSjxmVO[] listAggSjxmVOByCondition(String condition,String[] orderPath) throws BusinessException;

	/**
	 * 四级项目的主表VO查询操作
	 * 根据主键条件查询Agg数组
	 * @param pk主键
	 * @return 结果数组
	 */
	public SjxmHVO[] listSjxmHVOByPk(String...pks) throws BusinessException;

	/**
	 * 四级项目的主表VO查询操作
	 * 根据主键条件查询Agg对象
	 * @param pk 主键
	 * @return 结果对象
	 */
	public  SjxmHVO findSjxmHVOByPk(String pk) throws BusinessException;

	/**
	 * 四级项目的主表VO查询操作
	 * 根据条件字符串查询Agg数组
	 * @param condition 主键
	 * @return 结果数组
	 */
	public  SjxmHVO[] listSjxmHVOByCondition(String condition) throws BusinessException;
	/**
	 * 四级项目的主表VO查询操作
	 * 根据条件字符串查询Agg数组
	 * @param condition 主键
	 * @return 结果数组
	 */
	public  SjxmHVO[] listSjxmHVOByCondition(String condition,String[] orderPath) throws BusinessException;

	/**
	 * 四级项目的主表pk查询操作
	 * 根据条件字符串查询pk数组数组
	 * @param condition 查询方案+
	 * @return 结果数组
	 */
	public String[] listSjxmHVOPkByCond(String condition) throws BusinessException;

	/**
	 * 四级项目的主表pk查询操作
	 * 根据条件字符串查询pk数组数组
	 * @param condition 查询方案+
	 * @return 结果数组
	 */
	public String[] listSjxmHVOPkByCond(String condition,String[] orderPath) throws BusinessException;
	/**
	 * 给主实体vo设置默认值
	 * @param vo
	 */
	public void initDefaultData(SjxmHVO vo);


	/**
	 * 预新增操作四级项目数据
	 * @param userJson  新增时需要的扩展参数对象
	 */
	public AggSjxmVO preAddAggSjxmVO(Map<String,Object> userJson) throws BusinessException;

	public AggSjxmVO preAddAggSjxmVO(AggSjxmVO vo,Map<String,Object> userJson) throws BusinessException;
	 /**
	 * 预编辑操作四级项目数据
	 * @param userJson  新增时需要的扩展参数对象
	 */
	public AggSjxmVO preEditAggSjxmVO(String pk) throws BusinessException;

	 /**
	 * 复制操作四级项目数据
	 *
	 */
	public AggSjxmVO copyAggSjxmVO(String pk) throws BusinessException;
	/**
	 * 保存操作四级项目数据
	 * @param vos 保存对象
	 * @return @
	 */

	public AggSjxmVO[] saveAggSjxmVO(AggSjxmVO vo) throws BusinessException;
	public AggSjxmVO[] saveAggSjxmVO(AggSjxmVO[] vos) throws BusinessException;

	public AggSjxmVO[] saveAggSjxmVO(AggSjxmVO vo, String node) throws BusinessException;
	public AggSjxmVO[] saveAggSjxmVO(AggSjxmVO[] vos, String node) throws BusinessException;

	/**
	 * 删除操作四级项目数据
	 * @param vos 删除对象
	 * @return @
	 */
	public AggSjxmVO[] deleteAggSjxmVOs(Map<String,String> tsMap) throws BusinessException;
	public AggSjxmVO[] deleteAggSjxmVOs(Map<String,String> tsMap, String nodetype) throws BusinessException;

	/**
	 * 加载树类型数据四级项目
	 * @param vos 对象
	 * @return @
	 */
	public <T> T[] loadTreeData(Class<T> clazz,Map<String,Object> userJson) throws BusinessException;

	/**
	 * 根据主表主键查询子表pks
	 * @param childClazz 子表class
	 * @param parentId 主表主键
	 * @return 子表pks
	 * @throws BusinessException
	 */
	String[] queryChildPksByParentId(Class childClazz, String parentId) throws BusinessException;

	/**
	 * 根据子表主键查询子表数据
	 * @param childClazz 子表class
	 * @param pks 子表
	 * @return 子表vos
	 * @throws BusinessException
	 */
	SuperVO[] queryChildVOByPks(Class childClazz, String[] pks) throws BusinessException;
	/**
	 * 单个提交
	 * @param actionName 动作脚本编码
	 * @param tsMap  key为主键  value为ts
	 * @param assign 指派信息，只有单个提交允许指派
	 * @return Object
	 * @throws BusinessException
	 */
	public Object commitAggSjxmVO(String actionName,Map<String,String> tsMap,Object assign) throws BusinessException;
	/**
	 * 批量提交
	 * @param actionName 动作脚本编码
	 * @param tsMap  key为主键  value为ts
	 * @throws BusinessException
	 */
	public Object batchCommitAggSjxmVO(String actionName,Map<String,String> tsMap) throws BusinessException;
	/**
	 * 单个收回
	 * @param actionName 动作脚本编码
	 * @param tsMap  key为主键  value为ts
	 * @return
	 * @throws BusinessException
	 */
	public Object uncommitAggSjxmVO(String actionName,Map<String,String> tsMap) throws BusinessException;
	/**
	 * 批量收回
	 * @param actionName 动作脚本编码
	 * @param tsMap  key为主键  value为ts
	 * @throws BusinessException
	 */
	public Object batchUncommitAggSjxmVO(String actionName,Map<String,String> tsMap) throws BusinessException;
	/**
	* SAVE 回调--动作脚本处调用
	* @param vos
	* @throws BusinessException
	* @return
	*/
	public AggSjxmVO[] callbackSAVE(AggSjxmVO...vos) throws BusinessException;

	/**
	* UNSAVE 回调--动作脚本处调用
	* @param vos
	* @throws BusinessException
	* @return
	*/
	public AggSjxmVO[] callbackUNSAVE(AggSjxmVO...vos) throws BusinessException;

	/**
	* APPROVE 回调--动作脚本处调用
	* @param vos
	* @throws BusinessException
	* @return
	*/
	public AggSjxmVO[] callbackAPPROVE(AggSjxmVO...vos) throws BusinessException;

	/**
	* SAVEBASE 回调--动作脚本处调用
	* @param vos
	* @throws BusinessException
	* @return
	*/
	public AggSjxmVO[] callbackSAVEBASE(AggSjxmVO...vos) throws BusinessException;

	/**
	* UNAPPROVE 回调--动作脚本处调用
	* @param vos
	* @throws BusinessException
	* @return
	*/
	public AggSjxmVO[] callbackUNAPPROVE(AggSjxmVO...vos) throws BusinessException;


	/**
	 * 获取默认(全局)编码规则上下文
	 *
	 * @param coderuleid 编码规则主键?
	 * @return 编码规则上下文
	 * @throws BusinessException
	 */
	public BillCodeContext getBillCodeContext(String coderuleid) throws BusinessException;

	/**
	 * 获取编码规则上下文
	 *
	 * @param coderuleid
	 * @param pkgroup
	 * @param pkorg
	 * @return
	 * @throws BusinessException
	 */
	public BillCodeContext getBillCodeContext(String coderuleid, String pkgroup, String pkorg) throws BusinessException;

}
